package com.property.manage.dao.flowingWater;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.property.manage.model.equipment.EquipmentEntity;
import com.property.manage.model.equipment.EquipmentVo;
import com.property.manage.model.flowingWater.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * 描述
 *
 * @author lwb
 * @since 2020/7/15
 */
@Repository
public interface FlowingWaterMapper extends BaseMapper<FlowingWaterEntity> {
    //其他费用列表
    IPage<FlowingWaterVo> getPage(@Param("page") IPage<FlowingWaterVo> page, @Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("building")Integer building,@Param("unit") Integer unit, @Param("roomNumber")String roomNumber);
    //维修费用列表
    IPage<FlowingWaterVo> getPageRepair(@Param("page") IPage<FlowingWaterVo> page, @Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("relationId") Integer relationId);

    FlowingWaterVo getById(@Param("id") Integer id);


    FlowingWaterVo queryById(@Param("id") Integer id);

    TotalVo getCount(@Param("type") Integer type, @Param("chargeType") Integer chargeType, @Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime);
    TotalVo getCountTotal(@Param("chargeType") Integer chargeType, @Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime);
    TotalVo selectProByTime(@Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime);
     //物业费列表
    IPage<FlowingWaterVo> getWuYePage(@Param("page") IPage<FlowingWaterVo> page, @Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime
            , @Param("drawer") String drawer, @Param("building") String building,@Param("unit") String unit,@Param("roomNumber") String roomNumber);


    IPage<FlowingWaterVo> getPrePage(@Param("page") IPage<FlowingWaterVo> page, @Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime
            , @Param("billNo") String billNo, @Param("building") String building,@Param("unit") String unit,@Param("roomNumber") String roomNumber);

    StatisticsVo statistics(@Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime
            , @Param("drawer") String drawer, @Param("building") String building,@Param("unit") String unit,@Param("roomNumber") String roomNumber);

    TotalVo selectRoutine( @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("villageId") Integer villageId);
    TotalVo selectRoutineByBuildingId( @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("ids") List<Integer> ids);
    TotalVo selectOtherByBuildingId( @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("ids") List<Integer> ids);
    TotalVo selectProByBuildingId( @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("ids") List<Integer> ids);
    TotalVo selectRoutineDetailed(@Param("startTime") String startTime);
    TotalVo selectOther( @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("villageId") Integer villageId);
    TotalVo selectOtherDetailed( @Param("startTime") String startTime);
    TotalVo selectPro( @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("villageId") Integer villageId);
    TotalVo selectProDetailed( @Param("startTime") String startTime);

    //查找有入账的日期
    List<String> selectTime(@Param("startTime") String startTime, @Param("endTime") String endTime);
    //查找当前时间段有入账的小区id
    List<Integer> selectBuilding(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("villageId") Integer villageId);


    FlowingMoneyVo getMoney(@Param("villageId") Integer villageId, @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("building")Integer building,@Param("unit") Integer unit, @Param("roomNumber")String roomNumber);

    List<MonthStatisticVo.Detail> unitRooms(@Param("villageId") Integer villageId);

    List<MonthStatisticVo.Detail> unitPayed(@Param("villageId") Integer villageId, @Param("month") String month, @Param("month1") String month1);

    List<MonthStatisticVo.Detail> unitOwn(@Param("villageId") Integer villageId, @Param("month") String month, @Param("month1") String month1);


    /**
     * 统计欠费补缴
     * @param villageId
     * @param month
     * @return
     */
    List<MonthStatisticVo.Detail> unitOwnPayment(@Param("villageId") Integer villageId, @Param("month") String month);

}
